package com.maychat.mapper;

import com.maychat.pojo.UserContact;
import com.maychat.pojo.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface UserInfoMapper {

    @Insert("""
            insert into user_info (user_id, email, nick_name, phone, sex, password, personal_signature, status, create_time,
                                   last_login_time, last_offline_time, region, region_code, join_type)
            values (#{userId}, #{email}, #{nickName}, #{phone}, #{sex}, #{password},#{personalSignature}, #{status}, #{createTime}, #{lastLoginTime}, #{lastOfflineTime},#{region}, #{regionCode}, #{joinType})""")
    void insertUserInfo(UserInfo userInfo);

    List<UserInfo> selectUserInfos(UserInfo userInfo);

    UserInfo selectUserInfoWithPwd(UserInfo userInfo);

    void updateUserInfoById(UserInfo userInfo);

    List<UserInfo> selectUserInfosByUserContact(UserContact userContact);

    List<UserInfo> selectFriendUserInfos(String userId);


    UserInfo selectUserInfoById(String userId);
}
